package com.gitee.aurora.server.controller;


import com.gitee.aurora.core.utils.ResultVO;
import com.gitee.aurora.core.utils.ResultVOUtils;
import com.gitee.aurora.server.service.SjjcLogInfoService;
import com.gitee.aurora.server.vo.SjjcLogInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/sjjcLogInfo")
@Api(value = "通信日志类", tags = {"通信日志管理类接口"})
public class SjjcLogInfoController {

    @Autowired
    private SjjcLogInfoService sjjcLogInfoService;
    /**
     *插入平台通信日志
     */
    @PostMapping("/insertSjjcLogInfo")
    @ApiOperation(value = "插入平台通信日志", notes = "插入平台通信日志")
    public ResultVO insertSjjcLogInfo(@RequestBody SjjcLogInfo sjjcLogInfo) {
        int result=0;
        try {
            result= sjjcLogInfoService.insertSjjcLogInfo(sjjcLogInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return  ResultVOUtils.success(result);
    }

    /**
     *获取检测对象状态
     */
    @ApiOperation(value = "根据code值获取检测对象状态", notes = "根据code值获取检测对象状态")
    @PostMapping("/querySjjcLogInfo")
    public ResultVO<List<SjjcLogInfo>> querySjjcLogInfo(@RequestBody SjjcLogInfo sjjcLogInfo)  {
        List<SjjcLogInfo> sjjcLogInfoList= null;
        try {
            sjjcLogInfoList = sjjcLogInfoService.querySjjcLogInfo(sjjcLogInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return ResultVOUtils.success(sjjcLogInfoList);
    }




}
